package com.itheima.controller;

import com.itheima.feign.PaymentFeign;
import com.itheima.pojo.CommentResult;
import com.itheima.pojo.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping
public class OrderController {
    @Autowired
    private PaymentFeign paymentFeign;

    @GetMapping("/consumer/findById/{id}")
    public CommentResult findById(@PathVariable("id") Integer id) {
        return paymentFeign.findById(id);
    }

    @PostMapping("/consumer/insert")
    public CommentResult insert(@RequestBody Payment payment) {
        return this.paymentFeign.insert(payment);
    }
}
